#-*- coding:utf-8 -*-
from PIL import Image
from cgai_img.size import img_resize
from cgai_img.format import img2ico
from cgai_img.op import *
# from cgai_img.upload import *

# #图片转ico
# # path = r'C:\Users\zxzxde\Desktop\imgs\ani.png'
# path = r'C:\Users\Admin\PyOut\TimeAxis\timeaxis_task_record\imgs\r.png'
# path = r'C:\Users\Admin\Desktop\img\logo.png'
# path = r'C:\Users\Admin\Desktop\img\info.jpg'
# path = r'D:\PyOut\CGAI\cgai-py2pyc\py2pyc.png'
# outpath = r'C:\Users\Admin\PyOut\TimeAxis\timeaxis_task_record\imgs\r.ico'
# outpath = r'C:\Users\Admin\Downloads\Compressed\hex_1.1.10_1621_windows32\Release\r.ico'
# outpath1 = r'D:\PyOut\TestAll\PyQt\TrayIcon\cgai.icns'
# outpath1 = r'D:\PyOut\CGAI\cgai-py2pyc\py2pyc.ico'
# img2ico(path,outpath,size=(128,128))
# img2ico(path,outpath1,size=(100,100))
# img2ico(path,outpath1,size=(128,128))


# 上传图片到图床并返回图片url
# img_path = r'C:\Users\laozhang\Desktop\imgs\abc.png'
# ch_exe = r'F:\PycharmOut\Selenium\chromedriver.exe'

# # 上传图片到薄荷图床
# url = uploadToRiyugo(img_path,ch_exe)
# print(url)

# 上传图片到imgurl
# url = uploadToImgurl(img_path,ch_exe)
# print(url)

# 上传图片到imgtu
# url = uploadToImgtu(img_path,ch_exe)
# print(url)

# resize图片
# p = r'C:\Users\Admin\HoudiniProject\CGAI\AlignHead\imgs\yy.png'
# img = Image.open(p)
# newimg = img_resize(img,(224,224))
# newimg.save(r'C:\Users\Admin\HoudiniProject\CGAI\AlignHead\imgs\yy1.png')


# # 翻转图片
# newimg = flip_image(r'C:\Users\Admin\Desktop\1.jpg')
# newimg.save(r'C:\Users\Admin\Desktop\2.jpg')


# # 旋转图片
# newimg = rotate_image(r'C:\Users\Admin\Desktop\1.jpg',45)
# newimg.save(r'C:\Users\Admin\Desktop\3.jpg')

# 移除背景
newimg = remove_bg(r'C:\Users\Admin\Desktop\1.jpg')
newimg.save(r'C:\Users\Admin\Desktop\4.png')




